package 一些笔试真题;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a
 * Date: 2022-10-05
 * Time: 15:36
 */

/*
    递增子序列
 */
public class guazi_1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] q = new int[n];
        for(int i = 0; i < n; i++){
            q[i] = scanner.nextInt();
        }
        int first = q[0];
        int second = Integer.MAX_VALUE;
        for(int i = 1; i < n; i++){
            if(q[i] < first){
                first = q[i];
                second = Integer.MAX_VALUE;
            }else if(q[i] > first && q[i] < second){
                second = q[i];
            }else if(q[i] > second){
                System.out.println("true");
                return;
            }
        }
        System.out.println("false");
    }
}
